package com.hongsuan.pplive.mobileAPI.vo;

import java.io.Serializable;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;

import com.hongsuan.pplive.mobileAPI.utils.JsonUtils;

public class ReturnList extends Status implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 2388283837263541L;

	/**
	 * 记录条数
	 */
	//private int count;

	private Collection<?> list;

	public int getCount() {
		if (list != null)
			return list.size();
		else
			return 0;
	}
	

	 
	  //public void setCount(int count) { this.count = count; }
	  

	public Collection<?> getList() {
		return list;
	}


	public void setList(Collection<?> list) {
		this.list = list;
	}


	@Override
	public String toString() {
		Map<String,Object>data = new HashMap<>();
		data.put("code", super.getCode());
		data.put("message", super.getMessage());
		data.put("count", getCount());
		data.put("items", list);
		return JsonUtils.toJson(data);
	}

}
